package com.wenjie.redHat.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wenjie.redHat.dao.OrderMapper;
import com.wenjie.redHat.domain.entity.OrderEntity;
import com.wenjie.redHat.domain.entity.ProductCategoryEntity;
import com.wenjie.redHat.domain.entity.ProductEntity;
import com.wenjie.redHat.service.OrderService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> implements OrderService {
    @Override
    public String updateByOrder(OrderEntity orderEntity) {

        OrderEntity orderEntity1 = getOne(new QueryWrapper<OrderEntity>()
                .eq("id", orderEntity.getId()));
        if (!ObjectUtils.isEmpty(orderEntity1)) {
            this.updateById(orderEntity);
        } else {
            return "修改失败";
        }
        return "修改成功";
    }
}
